<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Bluejay Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/Bluejay" class="dashAnchor"></a>
    <a title="Bluejay Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">Bluejay Docs</a> (100% documented)</p>
        <p class="header-right"><a href="https://github.com/steamclock/bluejay"><img src="../img/gh.png"/>View on GitHub</a></p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">Bluejay Reference</a>
        <img id="carat" src="../img/carat.png" />
        Bluejay Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/Bluejay.html">Bluejay</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/AutoReconnectMode.html">AutoReconnectMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BackgroundRestoreCompletion.html">BackgroundRestoreCompletion</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BackgroundRestoreMode.html">BackgroundRestoreMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BluejayError.html">BluejayError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ConnectionResult.html">ConnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/DisconnectionResult.html">DisconnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ListenAction.html">ListenAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ListenRestoreAction.html">ListenRestoreAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MultipleListenOption.html">MultipleListenOption</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ReadResult.html">ReadResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/RunResult.html">RunResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ScanAction.html">ScanAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/StartMode.html">StartMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/Timeout.html">Timeout</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/WriteResult.html">WriteResult</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/BinaryInteger.html">BinaryInteger</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBManagerState.html">CBManagerState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheral.html">CBPeripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheralState.html">CBPeripheralState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBService.html">CBService</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Data.html">Data</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Peripheral.html">Peripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/String.html">String</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/BackgroundRestorer.html">BackgroundRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ConnectionObserver.html">ConnectionObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/DisconnectHandler.html">DisconnectHandler</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ListenRestorer.html">ListenRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LogObserver.html">LogObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/RSSIObserver.html">RSSIObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Receivable.html">Receivable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Sendable.html">Sendable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ServiceObserver.html">ServiceObserver</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/BackgroundRestoreConfig.html">BackgroundRestoreConfig</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/DataPadding.html">DataPadding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ScanDiscovery.html">ScanDiscovery</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ServiceIdentifier.html">ServiceIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/StartOptions.html">StartOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/WarningOptions.html">WarningOptions</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay13LaunchOptionsa">LaunchOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay14ListenCallbacka">ListenCallback</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay17RestoreIdentifiera">RestoreIdentifier</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>Bluejay</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Bluejay</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>

                </div>
              </div>
            <p>Bluejay is a simple wrapper around CoreBluetooth that focuses on making a common usage case as straight forward as possible: a single connected peripheral that the user is interacting with regularly (think most personal electronics devices that have an associated iOS app: fitness trackers, guitar amps, etc).</p>

<p>It also supports a few other niceties for simplifying usage, including automatic discovery of services and characteristics as they are used, as well as supporting a background task mode where the interaction with the device can be written as synchronous calls running on a background thread to avoid callback pyramids of death, or heavily chained promises.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Public%20Properties"></a>
                <a name="//apple_ref/swift/Section/Public Properties" class="dashAnchor"></a>
                <a href="#/Public%20Properties">
                  <h3 class="section-name">Public Properties</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC4uuid10Foundation4UUIDVvp"></a>
                    <a name="//apple_ref/swift/Property/uuid" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC4uuid10Foundation4UUIDVvp">uuid</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Helps distinguish one Bluejay instance from another.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uuid</span><span class="p">:</span> <span class="kt">UUID</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC20isBluetoothAvailableSbvp"></a>
                    <a name="//apple_ref/swift/Property/isBluetoothAvailable" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC20isBluetoothAvailableSbvp">isBluetoothAvailable</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluetooth is powered on. Also returns false if Bluejay is not started yet.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isBluetoothAvailable</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp"></a>
                    <a name="//apple_ref/swift/Property/isBluetoothStateUpdateImminent" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp">isBluetoothStateUpdateImminent</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking for if CoreBluetooth state is transitional (update is imminent)
please re-evaluate the bluetooth state again as it may change momentarily after it has returned true</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isBluetoothStateUpdateImminent</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC12isConnectingSbvp"></a>
                    <a name="//apple_ref/swift/Property/isConnecting" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC12isConnectingSbvp">isConnecting</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay is currently connecting to a peripheral.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isConnecting</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC11isConnectedSbvp"></a>
                    <a name="//apple_ref/swift/Property/isConnected" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC11isConnectedSbvp">isConnected</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay is currently connected to a peripheral.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isConnected</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC15isDisconnectingSbvp"></a>
                    <a name="//apple_ref/swift/Property/isDisconnecting" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC15isDisconnectingSbvp">isDisconnecting</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay is currently disconnecting from a peripheral.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">private(set)</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">isDisconnecting</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC19shouldAutoReconnectSbvp"></a>
                    <a name="//apple_ref/swift/Property/shouldAutoReconnect" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC19shouldAutoReconnectSbvp">shouldAutoReconnect</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allowing checking whether Bluejay will automatic reconnect after an unexpected disconnection. Default is true, and Bluejay will also always set this to true on a successful connection to a peripheral. Conversely, Bluejay will always set this to false after an explicit disconnection request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">private(set)</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">shouldAutoReconnect</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10isScanningSbvp"></a>
                    <a name="//apple_ref/swift/Property/isScanning" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10isScanningSbvp">isScanning</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay is currently scanning.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isScanning</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10hasStartedSbvp"></a>
                    <a name="//apple_ref/swift/Property/hasStarted" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10hasStartedSbvp">hasStarted</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay has started and is available for use.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hasStarted</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp"></a>
                    <a name="//apple_ref/swift/Property/defaultWarningOptions" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp">defaultWarningOptions</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Warning options to use for each new connection if the options are not specified at the creation of those connections.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">private(set)</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">defaultWarningOptions</span><span class="p">:</span> <span class="kt"><a href="../Structs/WarningOptions.html">WarningOptions</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp"></a>
                    <a name="//apple_ref/swift/Property/isBackgroundRestorationEnabled" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp">isBackgroundRestorationEnabled</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows checking whether Bluejay has background restoration enabled.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isBackgroundRestorationEnabled</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Logging"></a>
                <a name="//apple_ref/swift/Section/Logging" class="dashAnchor"></a>
                <a href="#/Logging">
                  <h3 class="section-name">Logging</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC3logyySSF"></a>
                    <a name="//apple_ref/swift/Method/log(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC3logyySSF">log(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allow apps that use Bluejay to log alongside of Bluejay&rsquo;s internal logs.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">log</span><span class="p">(</span><span class="n">_</span> <span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>string</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>the message you want to log.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC7getLogsSSSgyF"></a>
                    <a name="//apple_ref/swift/Method/getLogs()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC7getLogsSSSgyF">getLogs()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Get the current content of the log file.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getLogs</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The current content of the log file as a String.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC9clearLogsyyF"></a>
                    <a name="//apple_ref/swift/Method/clearLogs()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC9clearLogsyyF">clearLogs()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Clears the log file.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">clearLogs</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Initialization"></a>
                <a name="//apple_ref/swift/Section/Initialization" class="dashAnchor"></a>
                <a href="#/Initialization">
                  <h3 class="section-name">Initialization</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@M@Bluejay@objc(cs)Bluejay(im)init"></a>
                    <a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
                    <a class="token" href="#/c:@M@Bluejay@objc(cs)Bluejay(im)init">init()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializing a Bluejay instance will not yet initialize the CoreBluetooth stack. An explicit <code>start</code> call after Bluejay is intialized will then initialize the CoreBluetooth stack and is required because in cases where a state resotration is trying to restore a listen on a characteristic, a listen restorer must be available before the CoreBluetooth stack is re-initialized. This two-step startup allows you to prepare and gaurantee the setup of your listen restorer in between the initialization of Bluejay and the initialization of the CoreBluetooth stack.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="nf">init</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC5start4modeyAA9StartModeO_tF"></a>
                    <a name="//apple_ref/swift/Method/start(mode:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC5start4modeyAA9StartModeO_tF">start(mode:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Starting Bluejay will initialize the CoreBluetooth stack. Simply initializing a Bluejay instance without calling this function will not initialize the CoreBluetooth stack. An explicit start call is required so that we can also support proper background restoration, where CoreBluetooth must be initialized in the AppDelegate&rsquo;s application(_:didFinishLaunchingWithOptions:) for both starting an iOS background task and for parsing the restore identifier.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="kt"><a href="../Enums/StartMode.html">StartMode</a></span> <span class="o">=</span> <span class="o">.</span><span class="nf">new</span><span class="p">(</span><span class="o">.</span><span class="k">default</span><span class="p">))</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>mode</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>CoreBluetooth initialization modes and options.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF"></a>
                    <a name="//apple_ref/swift/Method/stopAndExtractBluetoothState()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF">stopAndExtractBluetoothState()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Stops all operations and clears all states in Bluejay before returning a Core Bluetooth state that can then be used by another library or code outside of Bluejay.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    Will crash if Bluejay has not been instantiated properly or if Bluejay is still connecting.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stopAndExtractBluetoothState</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">manager</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Returns a CBCentralManager and possibly a CBPeripheral as well if there was one connected at the time of this call.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Cancellation"></a>
                <a name="//apple_ref/swift/Section/Cancellation" class="dashAnchor"></a>
                <a href="#/Cancellation">
                  <h3 class="section-name">Cancellation</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF"></a>
                    <a name="//apple_ref/swift/Method/cancelEverything(error:shouldDisconnect:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF">cancelEverything(error:shouldDisconnect:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This will cancel the current and all pending operations in the Bluejay queue. It will also disconnect by default after the queue is emptied, but you can cancel everything without disconnecting.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">cancelEverything</span><span class="p">(</span><span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span> <span class="o">=</span> <span class="kt"><a href="../Enums/BluejayError.html">BluejayError</a></span><span class="o">.</span><span class="n">cancelled</span><span class="p">,</span> <span class="nv">shouldDisconnect</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>error</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Defaults to a generic <code>cancelled</code> error. Pass in a specific error if you want to deliver a specific error to all of your running and queued tasks.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>shouldDisconnect</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Defaults to true, will not disconnect if set to false, but only matters if Bluejay is actually connected.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Events%20Registration"></a>
                <a name="//apple_ref/swift/Section/Events Registration" class="dashAnchor"></a>
                <a href="#/Events%20Registration">
                  <h3 class="section-name">Events Registration</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/register(connectionObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF">register(connectionObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">register</span><span class="p">(</span><span class="nv">connectionObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/ConnectionObserver.html">ConnectionObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>connectionObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object interested in receiving Bluejay&rsquo;s Bluetooth connection related events.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/unregister(connectionObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF">unregister(connectionObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unregister for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregister</span><span class="p">(</span><span class="nv">connectionObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/ConnectionObserver.html">ConnectionObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>connectionObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object no longer interested in receiving Bluejay&rsquo;s connection related events.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF"></a>
                    <a name="//apple_ref/swift/Method/register(rssiObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF">register(rssiObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register for notifications when <code>readRSSI</code> is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">register</span><span class="p">(</span><span class="nv">rssiObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RSSIObserver.html">RSSIObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>rssiObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object interested in receiving Bluejay&rsquo;s <code>readRSSI</code> response.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF"></a>
                    <a name="//apple_ref/swift/Method/unregister(rssiObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF">unregister(rssiObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unregister for notifications when <code>readRSSI</code> is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregister</span><span class="p">(</span><span class="nv">rssiObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RSSIObserver.html">RSSIObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>rssiObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object no longer interested in receiving Bluejay&rsquo;s <code>readRSSI</code> response.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC8register15serviceObserveryAA07ServiceD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/register(serviceObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC8register15serviceObserveryAA07ServiceD0_p_tF">register(serviceObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register for notifications when a connected peripheral&rsquo;s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">register</span><span class="p">(</span><span class="nv">serviceObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/ServiceObserver.html">ServiceObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>serviceObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object interested in receiving the connected peripheral&rsquo;s did modify services event.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10unregister15serviceObserveryAA07ServiceD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/unregister(serviceObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10unregister15serviceObserveryAA07ServiceD0_p_tF">unregister(serviceObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unregister for notifications when a connected peripheral&rsquo;s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregister</span><span class="p">(</span><span class="nv">serviceObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/ServiceObserver.html">ServiceObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>serviceObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object no longer interested in receiving the connected peripheral&rsquo;s did modify services event.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/register(logObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF">register(logObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">register</span><span class="p">(</span><span class="nv">logObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/LogObserver.html">LogObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>logObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object interested in receiving log file updates.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/unregister(logObserver:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF">unregister(logObserver:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unregister for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregister</span><span class="p">(</span><span class="nv">logObserver</span><span class="p">:</span> <span class="kt"><a href="../Protocols/LogObserver.html">LogObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>logObserver</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object no longer interested in notifications when the log file is updated.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF"></a>
                    <a name="//apple_ref/swift/Method/registerDisconnectHandler(handler:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF">registerDisconnectHandler(handler:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register a single disconnection handler for giving it a final say on what to do at the end of a disconnection, as well as evaluate and control Bluejay&rsquo;s auto-reconnect behaviour.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">registerDisconnectHandler</span><span class="p">(</span><span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../Protocols/DisconnectHandler.html">DisconnectHandler</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>handler</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>object interested in becoming Bluejay&rsquo;s optional but most featureful disconnection handler.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC27unregisterDisconnectHandleryyF"></a>
                    <a name="//apple_ref/swift/Method/unregisterDisconnectHandler()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC27unregisterDisconnectHandleryyF">unregisterDisconnectHandler()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Remove any registered disconnection handler.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregisterDisconnectHandler</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Scanning"></a>
                <a name="//apple_ref/swift/Section/Scanning" class="dashAnchor"></a>
                <a href="#/Scanning">
                  <h3 class="section-name">Scanning</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF"></a>
                    <a name="//apple_ref/swift/Method/scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF">scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Scan for the peripheral(s) specified.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>Setting <code>serviceIdentifiers</code> to <code>nil</code> will result in picking up all available Bluetooth peripherals in the vicinity, <strong>but is not recommended by Apple</strong>. It may cause battery and cpu issues on prolonged scanning, and <strong>it also doesn&rsquo;t work in the background</strong>. If you need to scan for all Bluetooth devices, we recommend making use of the <code>duration</code> parameter to stop the scan after 5 ~ 10 seconds to avoid scanning indefinitely and overloading the hardware.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">scan</span><span class="p">(</span>
    <span class="nv">duration</span><span class="p">:</span> <span class="kt">TimeInterval</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
    <span class="nv">allowDuplicates</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
    <span class="nv">throttleRSSIDelta</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">5</span><span class="p">,</span>
    <span class="nv">serviceIdentifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/ServiceIdentifier.html">ServiceIdentifier</a></span><span class="p">]?,</span>
    <span class="nv">discovery</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Structs/ScanDiscovery.html">ScanDiscovery</a></span><span class="p">,</span> <span class="p">[</span><span class="kt"><a href="../Structs/ScanDiscovery.html">ScanDiscovery</a></span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/ScanAction.html">ScanAction</a></span><span class="p">,</span>
    <span class="nv">expired</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Structs/ScanDiscovery.html">ScanDiscovery</a></span><span class="p">,</span> <span class="p">[</span><span class="kt"><a href="../Structs/ScanDiscovery.html">ScanDiscovery</a></span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/ScanAction.html">ScanAction</a></span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
    <span class="nv">stopped</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="kt"><a href="../Structs/ScanDiscovery.html">ScanDiscovery</a></span><span class="p">],</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
    <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>duration</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Stops the scan when the duration in seconds is reached. Defaults to zero (indefinite).</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>allowDuplicates</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Determines whether a previously scanned peripheral is allowed to be discovered again.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>throttleRSSIDelta</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Throttles discoveries by ignoring insignificant changes to RSSI.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>serviceIdentifiers</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Specifies what visible services the peripherals must have in order to be discovered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>discovery</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called whenever a specified peripheral has been discovered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>expired</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called whenever a previously discovered peripheral has not been seen again for a while, and Bluejay is predicting that it may no longer be in range. (Only for a scan with allowDuplicates enabled)</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>stopped</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called when the scan is finished and provides an error if there is any.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC12stopScanningyyF"></a>
                    <a name="//apple_ref/swift/Method/stopScanning()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC12stopScanningyyF">stopScanning()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Stops current or queued scan.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stopScanning</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Connection"></a>
                <a name="//apple_ref/swift/Section/Connection" class="dashAnchor"></a>
                <a href="#/Connection">
                  <h3 class="section-name">Connection</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF"></a>
                    <a name="//apple_ref/swift/Method/connect(_:timeout:warningOptions:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF">connect(_:timeout:warningOptions:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Attempt to connect directly to a known peripheral. The call will fail if Bluetooth is not available, or if Bluejay is already connected. Making a connection request while Bluejay is scanning will also cause Bluejay to stop the current scan for you behind the scene prior to fulfilling your connection request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">connect</span><span class="p">(</span>
    <span class="n">_</span> <span class="nv">peripheralIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a></span><span class="p">,</span>
    <span class="nv">timeout</span><span class="p">:</span> <span class="kt"><a href="../Enums/Timeout.html">Timeout</a></span> <span class="o">=</span> <span class="o">.</span><span class="k">none</span><span class="p">,</span>
    <span class="nv">warningOptions</span><span class="p">:</span> <span class="kt"><a href="../Structs/WarningOptions.html">WarningOptions</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ConnectionResult.html">ConnectionResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>peripheralIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The peripheral to connect to.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>timeout</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Specify how long the connection time out should be.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>warningOptions</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional connection warning options, if not specified, Bluejay&rsquo;s default will be used.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called when the connection request has ended.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF"></a>
                    <a name="//apple_ref/swift/Method/disconnect(immediate:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF">disconnect(immediate:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Disconnect a connected peripheral or cancel a connecting peripheral.</p>
<div class="aside aside-attention">
    <p class="aside-title">Attention</p>
    <p>If you are going to use the completion block, be careful on how you orchestrate and organize multiple disconnection callbacks if you are also using a <code><a href="../Protocols/DisconnectHandler.html">DisconnectHandler</a></code>.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">disconnect</span><span class="p">(</span><span class="nv">immediate</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Enums/DisconnectionResult.html">DisconnectionResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>immediate</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, the disconnect will not be enqueued and will cancel everything in the queue immediately then disconnect. If false, the disconnect will wait until everything in the queue is finished.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called when the disconnect request is fully completed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Actions"></a>
                <a name="//apple_ref/swift/Section/Actions" class="dashAnchor"></a>
                <a href="#/Actions">
                  <h3 class="section-name">Actions</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/read(from:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF">read(from:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read from the specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">read</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">from</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReadResult.html">ReadResult</a></span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characteristicIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic to read from.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called with the result of the attempt to read from the specified characteristic.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF"></a>
                    <a name="//apple_ref/swift/Method/write(to:value:type:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF">write(to:value:type:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Write to the specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">write</span><span class="o">&lt;</span><span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="o">&gt;</span><span class="p">(</span>
    <span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span>
    <span class="nv">type</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span> <span class="o">=</span> <span class="o">.</span><span class="n">withResponse</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/WriteResult.html">WriteResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characteristicIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic to write to.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Write type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called with the result of the attempt to write to the specified characteristic.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/listen(to:multipleListenOption:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF">listen(to:multipleListenOption:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Listen for notifications on the specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">listen</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span>
    <span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="n">multipleListenOption</span> <span class="nv">option</span><span class="p">:</span> <span class="kt"><a href="../Enums/MultipleListenOption.html">MultipleListenOption</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">trap</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReadResult.html">ReadResult</a></span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characteristicIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic to listen to.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called with the result of the attempt to listen for notifications on the specified characteristic.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF"></a>
                    <a name="//apple_ref/swift/Method/endListen(to:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF">endListen(to:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>End listening on the specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">endListen</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Enums/WriteResult.html">WriteResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characteristicIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic to stop listening to.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Called with the result of the attempt to stop listening to the specified characteristic.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF"></a>
                    <a name="//apple_ref/swift/Method/isListening(to:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF">isListening(to:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if a peripheral is listening to a specific characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">isListening</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>to</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic we want to check.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC8readRSSIyyKF"></a>
                    <a name="//apple_ref/swift/Method/readRSSI()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC8readRSSIyyKF">readRSSI()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Attempts to read the RSSI (signal strength) of the currently connected peripheral.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    Will throw if called while a Bluejay background task is running, or if not connected.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">readRSSI</span><span class="p">()</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Background%20Task"></a>
                <a name="//apple_ref/swift/Section/Background Task" class="dashAnchor"></a>
                <a href="#/Background%20Task">
                  <h3 class="section-name">Background Task</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF"></a>
                    <a name="//apple_ref/swift/Method/run(backgroundTask:completionOnMainThread:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF">run(backgroundTask:completionOnMainThread:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This is the simplest one as the background task will not return any typed values back to the completion block on finishing the background task, except for thrown errors, and it also doesn&rsquo;t provide an input for an object that might need thread safe access.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>Be careful not to access anything that is not thread safe inside background task.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">run</span><span class="p">(</span>
    <span class="nv">backgroundTask</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">,</span>
    <span class="nv">completionOnMainThread</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/RunResult.html">RunResult</a></span><span class="o">&lt;</span><span class="kt">Void</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>backgroundTask</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure with the jobs to be executed in the background.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completionOnMainThread</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure called on the main thread when the background task has either completed or failed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF"></a>
                    <a name="//apple_ref/swift/Method/run(backgroundTask:completionOnMainThread:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF">run(backgroundTask:completionOnMainThread:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>Be careful not to access anything that is not thread safe inside background task.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">run</span><span class="o">&lt;</span><span class="kt">Result</span><span class="o">&gt;</span><span class="p">(</span>
    <span class="nv">backgroundTask</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Result</span><span class="p">,</span>
    <span class="nv">completionOnMainThread</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/RunResult.html">RunResult</a></span><span class="o">&lt;</span><span class="kt">Result</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>backgroundTask</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure with the jobs to be executed in the background.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completionOnMainThread</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure called on the main thread when the background task has either completed or failed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF"></a>
                    <a name="//apple_ref/swift/Method/run(userData:backgroundTask:completionOnMainThread:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF">run(userData:backgroundTask:completionOnMainThread:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully, as well as supplying an object for thread safe access inside the background task.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>Be careful not to access anything that is not thread safe inside background task.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">run</span><span class="o">&lt;</span><span class="kt">UserData</span><span class="p">,</span> <span class="kt">Result</span><span class="o">&gt;</span><span class="p">(</span>
    <span class="nv">userData</span><span class="p">:</span> <span class="kt">UserData</span><span class="p">,</span>
    <span class="nv">backgroundTask</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a></span><span class="p">,</span> <span class="kt">UserData</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Result</span><span class="p">,</span>
    <span class="nv">completionOnMainThread</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/RunResult.html">RunResult</a></span><span class="o">&lt;</span><span class="kt">Result</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>userData</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Any object you wish to have thread safe access inside background task.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>backgroundTask</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure with the jobs to be executed in the background.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completionOnMainThread</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A closure called on the main thread when the background task has either completed or failed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Helpers"></a>
                <a name="//apple_ref/swift/Section/Helpers" class="dashAnchor"></a>
                <a href="#/Helpers">
                  <h3 class="section-name">Helpers</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ"></a>
                    <a name="//apple_ref/swift/Method/combine(sendables:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ">combine(sendables:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>A helper function to take an array of Sendables and combine their data together.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">combine</span><span class="p">(</span><span class="nv">sendables</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt">Data</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>sendables</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An array of Sendables whose Data should be appended in the order of the given array.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The resulting data of all the Sendables combined in the order of the passed in array.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/CBCentralManagerDelegate"></a>
                <a name="//apple_ref/swift/Section/CBCentralManagerDelegate" class="dashAnchor"></a>
                <a href="#/CBCentralManagerDelegate">
                  <h3 class="section-name">CBCentralManagerDelegate</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:"></a>
                    <a name="//apple_ref/swift/Method/centralManagerDidUpdateState(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:">centralManagerDidUpdateState(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Bluejay uses this to figure out whether Bluetooth is available or not.</p>

<ul>
<li>If Bluetooth is available for the first time, start running the queue.</li>
<li>If Bluetooth is available for the first time and the app is already connected, then this is a state restoration event. Try listen restoration if possible.</li>
<li>If Bluetooth is turned off, cancel everything with the <code>bluetoothUnavailable</code> error and disconnect.</li>
<li>Broadcast state changes to observers.</li>
</ul>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManagerDidUpdateState</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:"></a>
                    <a name="//apple_ref/swift/Method/centralManager(_:willRestoreState:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:">centralManager(_:willRestoreState:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>If Core Bluetooth will restore state, update Bluejay&rsquo;s internal states to match the states of the Core Bluetooth stack by assigning the peripheral to <code>connectingPeripheral</code> or <code>connectedPeripheral</code>, or niling them out, depending on what the restored <code>CBPeripheral</code> state is.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManager</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="n">willRestoreState</span> <span class="nv">dict</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">Any</span><span class="p">])</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:"></a>
                    <a name="//apple_ref/swift/Method/centralManager(_:didConnect:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:">centralManager(_:didConnect:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>When connected, update Bluejay&rsquo;s states by updating the values for <code>connectingPeripheral</code>, <code>connectedPeripheral</code>, and <code><a href="../Classes/Bluejay.html#/s:7BluejayAAC19shouldAutoReconnectSbvp">shouldAutoReconnect</a></code>. Also, make sure to broadcast the event to observers, and notify the queue so that the current operation in-flight can process this event and get a chance to finish.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManager</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="n">didConnect</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:"></a>
                    <a name="//apple_ref/swift/Method/centralManager(_:didDisconnectPeripheral:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:">centralManager(_:didDisconnectPeripheral:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Handle a disconnection event from Core Bluetooth by figuring out what kind of disconnection it is (planned or unplanned), and updating Bluejay&rsquo;s internal state and sending notifications as appropriate.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManager</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="n">didDisconnectPeripheral</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:"></a>
                    <a name="//apple_ref/swift/Method/centralManager(_:didFailToConnect:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:">centralManager(_:didFailToConnect:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This mostly happens when either the Bluetooth device or the Core Bluetooth stack somehow only partially completes the negotiation of a connection. For simplicity, Bluejay is currently treating this as a disconnection event, so it can perform all the same clean up logic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManager</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="n">didFailToConnect</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:"></a>
                    <a name="//apple_ref/swift/Method/centralManager(_:didDiscover:advertisementData:rssi:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:">centralManager(_:didDiscover:advertisementData:rssi:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This should only be called when the current operation in the queue is a <code>Scan</code> task.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">centralManager</span><span class="p">(</span><span class="n">_</span> <span class="nv">central</span><span class="p">:</span> <span class="kt">CBCentralManager</span><span class="p">,</span> <span class="n">didDiscover</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="nv">advertisementData</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">Any</span><span class="p">],</span> <span class="n">rssi</span> <span class="kt">RSSI</span><span class="p">:</span> <span class="kt">NSNumber</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>Copyright © 2017 Steamclock Software. All rights reserved.</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
